/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Com.TransaksiParkirdanLaporan.Com.Laporan;

import Com.TransaksiParkirdanLaporan.Com.Transaksi.DataParkir;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Yosefina
 */
public class LaporanKeuanganHarianTabelModel extends AbstractTableModel {

    private List<DataParkir> rekap = new ArrayList<DataParkir>();

    public LaporanKeuanganHarianTabelModel(List<DataParkir> parkir) {
        this.rekap = parkir;
    }

    public int getRowCount() {
        return rekap.size();
    }

    public int getColumnCount() {
        return 4;


    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        DataParkir rekap2 = rekap.get(rowIndex);
        NumberFormat number = NumberFormat.getCurrencyInstance();
        switch (columnIndex) {
            case 0:
                return rekap2.getIdKaryawan();
            case 1:
                return rekap2.getNoPolisiKendaraan();
            case 2:
                return rekap2.getJumlahHelm();
            case 3:
                return number.format(rekap2.getBiaya_parkir());
            default:
                return "";

        }
    }

    @Override
    public String getColumnName(int column) {
        switch (column) {
            case 0:
                return "OPERATOR";
            case 1:
                return "NOMOR POLISI";
            case 2:
                return "JUMLAH HELM";
            case 3:
                return "BIAYAPARKIR";
            default:
                return "";
        }
    }
}
